package com.hua.jdk8;

import java.util.Arrays;
import java.util.List;

/**
 * @author: _hua
 * @created: 2019/3/30.
 * @updater:
 * @description:
 */
public class LmadaMap {

    public static void main(String args[]){
        // applying 12% VAT on each purchase
        // Without lambda expressions:
       /* List costBeforeTax = Arrays.asList(100, 200, 300, 400, 500);
        for (Integer cost : costBeforeTax) {
            double price = cost + .12*cost;
            System.out.println(price);
        }*/

        // With Lambda expression:
      /*  List costBeforeTax = Arrays.asList(100, 200, 300, 400, 500);
        costBeforeTax.stream().map((cost) -> cost + .12*cost).forEach(System.out::println);*/
    }
}
